#include<iostream>
using namespace std;
int n;
int main()
{
	cin>>n;
	n--;
	n=(n+2)%7;
	cout<<n+1<<endl;
	return 0;
}
